			 
		     <%= hidden_field_tag "question_type_id", @question.question_type_id%>	
	         <%= hidden_field_tag "question_id", @question.id%>
		  			 
			 	<%@sub_questions = Question.where(["parent_id = ?", @question.id])%>
				     <%@ans = []%> 
    					 <%@sub_questions.each do|sq|%> 
        				  <%@answer = Answer.find_by_question_id(sq.id)%>
       					  <%@ans << @answer%> 
						  <%@ans = @ans.sort_by { rand }%>
      					 <%end%>
						 
			        <table cellpadding="0" cellspacing="0" border="0" class="tblRepeter" id="toggle_<%=@question.id%>" style="margin: 0pt 5px 10px; width: 99%;">
				  	<tr>
				  		<th valign="top"><strong>Match Option A</strong></th>
						<th valign="top"><strong>Match Option B</strong></th>
				  	</tr>	
					<tr align="left">		 
					<td>
		  				<div class="tblCols rowValue" style="width: 256px; margin: 0pt 0pt 0pt 60px;">	
						<%@sub_questions.each do|s|%> 
							<div class="tblRepeaterRow" title="<%=s.name%>">  
			    			<%= text_field_tag :answer,truncate(s.name,:length=>30), :style=>"width:200px; height:19px; border:#d1d1d1 1px solid; background:#cfcfcf;", :readonly => true, :id=>s.id%>

							</div>
						<%end%>
		 				</div>
					</td>  	 
					
		  <%@checkAttended = Evaluation.where(["question_id = ? and categoryexam_id = ? and categoryuser_id = ? and has_attended = ? and attempt = ?", @question.id,@categoryExam,@categoryUser,true,@attempt])%>
						<%@checkAttended.each do|attended|%> 
						<%= hidden_field_tag "current_answer_id[]", attended.id%>
						<%end%>
					<%if @checkAttended.empty?%>
					
					<td>
		  				<div class="tblCols rowValue" style="width: 256px; margin: 0pt 0pt 0pt 60px;">	
						<ul id="sortable" style="width: 99%; float: left;">
						<%@ans.each do|a|%> 
						    
							  <li style="padding-left: 0px; padding-top: 0px; margin:0px 0 8px 0; font-size: 13px; float:left; width:90%;">
							  <div class="tblRepeaterRow" style="margin-bottom: 11px;" title="<%=a.match_answer%>">
								<%= label_tag :answer,truncate(a.match_answer, :length=>30), :style=>"width: 200px; height: 18px; border: 1px solid rgb(209, 209, 209); display: block; float: left; padding-left: 2px;", :disabled => true, :id=>a.id%>
								<%= hidden_field_tag "answer_id[]",a.id %>
								</div>
							  </li>

						<%end%>
						</ul>
		 				</div>
					</td>
					<%else%>
					<td>
		  				<div class="tblCols rowValue" style="width: 256px; margin: 0pt 0pt 0pt 60px;">
						<ul id="sortable" style="width:99%; float:left; padd">
						
					    <%@checkAttended.each do |a|%>
						   <li style="padding-left: 0px; padding-top: 0px; margin:0px 0 8px 0; font-size: 13px; float:left; width:90%;">
						    <div class="tblRepeaterRow" style="margin-bottom:0px;">
						    	<%#=a.id%>
						    	<%answer = Answer.find_by_id(a.answer_id)%>
						    	<span style="margin-left:0px;" title="<%=answer.match_answer%>"><%= label_tag :answer,truncate(answer.match_answer, :length=>30), :style=>"width:200px; height:19px; border:#d1d1d1 1px solid; display: block; float:left; padding-left: 2px;", :disabled => true, :id=>a.id%></span>
							    <%= hidden_field_tag "answer_id[]",a.answer_id %>
								<%= hidden_field_tag "evaluation_id[]", a.id%>
							</div>
							</li>
						<%end%>
						</ul>
		 				</div>
					</td>
					<%end%>	
					</tr>
					</table>